Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Movie Functions


OpenMovieFile

The OpenMovieFile function opens a specified movie file. Your application identifies the movie file with a file system specification.

pascal OSErr OpenMovieFile (const FSSpec *fileSpec,
                              short *resRefNum, char perms);
fileSpec
Contains a pointer to the file system specification for the movie file to be opened.
resRefNum
Contains a pointer to a field that is to receive the file reference number for the opened movie file. Your application must use this value when calling other Movie Toolbox functions that work with movie files. This reference number refers to the file fork that contains the movie resource--if the movie is stored in the data fork of the file, the returned reference number corresponds to the data fork.
perms
Specifies the permission level for the file. If your application is only going to play the movie that is stored in the file, you can open the file with read permission. If you plan to add data to the file or change data in the file, you should open the file with write permission. Supply a valid File Manager permission value. See Inside Macintosh: Files for valid values.
DESCRIPTION
Your application must open a movie file before reading movie data from it or writing movie data to it. You can open a movie file more than once--be sure to call CloseMovieFile (described in the next section) once for each time you call OpenMovieFile.

Note that opening the movie file with write permission does not prevent other applications from reading data from the movie file.

If the specified file has a resource fork, the OpenMovieFile function opens the resource fork and returns a file reference number to the resource fork. If the movie file does not have a resource fork (that is, it is a single-fork movie file--see the chapter "Movie Resource Formats" in this book for more information), the OpenMovieFile function opens the data fork instead. In this case, your application cannot use the AddMovieResource function (described on page 2-90) with the movie file.

ERROR CODES
movieToolboxUninitialized-2020You haven't initialized the Movie Toolbox
File Manager errors
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996